home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 3254 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  3.0 KB

  1. Path: informatik.tu-muenchen.de!fischerj
  2. From: fischerj@informatik.tu-muenchen.de (Juergen "Rally" Fischer)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: Fastest way to clear a Window?
  5. Date: 9 Feb 1996 15:23:48 GMT
  6. Organization: Technische Universitaet Muenchen, Germany
  7. Distribution: world
  8. Message-ID: <4ffou4$dne@sunsystem5.informatik.tu-muenchen.de>
  9. References: <4fck5b$7mm@leofric.coventry.ac.uk> <4fcush$58b@apoll.informatik.uni-bonn.de>
  10. NNTP-Posting-Host: hphalle5.informatik.tu-muenchen.de
  11. Originator: fischerj@hphalle5.informatik.tu-muenchen.de
  12.  
  13.  
  14. In article <4fcush$58b@apoll.informatik.uni-bonn.de>, malerz@athene.informatik.uni-bonn.de (Andreas Malerz) writes:
  15. |> Organization: Rheinische Friedrich-Wilhelms-Universit"at Bonn, Institut
  16. |> Lines: 30
  17. |> Message-ID: <4fcush$58b@apoll.informatik.uni-bonn.de>
  18. |> References: <4fck5b$7mm@leofric.coventry.ac.uk>
  19. |> NNTP-Posting-Host: malve.informatik.uni-bonn.de
  20. |> X-Newsreader: TIN [version 1.2 PL2]
  21. |> 
  22. |> Dave Jackson (dj@coventry.ac.uk) wrote:
  23. |> : I'm writing a 3d graphics viewer thingy using intuition windows.  What I 
  24. |> : want to know is, what is the fastest way of clearing a window?  At the 
  25. |> : moment I'm using SetRast() but there must be a faster way.  I'm using a 
  26. |> : custom screen, so I could make it draw lines on a single bitplane and 
  27. |> : then just clear that one plane, but the RKM:Libraries has nothing on how 
  28. |> : to clear one plane...  help!
  29.  
  30. sorry don't know, but why do you want to clear a window quick ?
  31. do you intend to clear and then draw ?
  32.  
  33. this might flicker...
  34.  
  35. I'd build the 3d object in mem. IF a point averagely is overwritten
  36. more than about 2 times, rendering to fastmem and then copying to
  37. a chipmem bitmap is faster.
  38. When done, copy the bitmap into the window with blitbitmaprastport().
  39.  
  40. Don't know about the 1-plane problem, though...
  41.  
  42. |> 
  43. |> : TIA
  44. |> : Dave Jackson
  45. |> 
  46. |> Depending on your processor, you can try to do it with the CPU itself.
  47. |> The fastest way I know is the following:
  48. |> 
  49. |>   Save all registers on STACK
  50. |>   Save STACK-Pointer somewhere else
  51. |> 
  52. |>   Clear all registers
  53. |>   Put the Address of your bitplane in one Adressregister
  54. |>   Copy the registers to your plane with "movem"
  55. |>   Do the last step as often as necessary.
  56. |> 
  57. |>   Restore STACK-Pointer
  58. |>   Restore all registers.
  59. |> 
  60. |> This solution is systemfriendly and on a fast processor faster than the
  61. |> blitter.
  62.  
  63. a) it is not systemfriendly, as you must turn off interrupt 
  64.    if sp doesn't point to enough free space.
  65.  
  66. b) Forgett all that movem crap unless you're not on a A500.
  67.    on A1200, this is the loop you can't beat:
  68.  
  69. clear:
  70.    move.l d0,(a0)+
  71.    dbra d7,clear
  72.  
  73. This runs 8cycles/longword on A1200 and you won't get it faster
  74. (The dbra doesn't disturb, "free cycles" on 020+).
  75.  
  76. BTW this method might not be useful for clearing windows...
  77.  
  78. |> 
  79. |>     Best greetings,
  80. |>         Andy.
  81. ------------------------------------------------------------------------
  82.    fischerj@Informatik.TU-Muenchen.DE (Juergen "Rally" Fischer)   =:)
  83.  
  84.